home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Amiga Collections: Camelot
/
Camelot 134 (1991-10)(Swedish User Group of Amiga)(SE)(PD)[WB].zip
/
Camelot 134 (1991-10)(Swedish User Group of Amiga)(SE)(PD)[WB].adf
/
GIFMachine
/
Sources
/
myprintf.c
< prev
next >
Wrap
C/C++ Source or Header
|
1991-09-01
|
783b
|
42 lines
#include <clib/dos_protos.h>
extern struct DosLibrary *DOSBase;
#include <pragmas/dos_lib.h>
#include <stdarg.h>
void RawDoFmt(char *, APTR, void(*)(), APTR);
#pragma syscall RawDoFmt 20a ba9804
void __stdargs MyPrintf(char *fmt, ...)
{
va_list args;
va_start(args, fmt);
VPrintf((UBYTE *)fmt, (LONG *)args);
Flush(Output());
va_end(args);
}
static void __regargs MySPrintfSupp(char);
void __stdargs MySPrintf(char *buf, char *fmt, ...)
{
va_list args;
va_start(args, fmt);
RawDoFmt(fmt, (APTR)args, MySPrintfSupp, (APTR)buf)
va_end(args);
}
extern long __builtin_getreg(int);
extern void __builtin_putreg(int, char *);
static void __regargs MySPrintfSupp(char Char)
{
char *ptr;
ptr = (char *)__builtin_getreg(11);
*ptr++ = Char;
__builtin_putreg(11, ptr);
}